﻿@model IList<Qu.SeniorProject.Model.Project>



@section head {

	<style type="text/css">
		a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
        .col1
        {
            width: 100%;
            padding:5px;
        }
        textarea 
        {
          display: block;
          width:100%;
          height:100%;
          border:1px solid blue;
        }
        
        label { width: 10em; float: left; }
        label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
        p { clear: both; }
        .submit { margin-left: 12em; }
        em { font-weight: bold; padding-right: 1em; vertical-align: top; color: red; }
	</style>

    <link href="@Url.Content("~/Content/colorbox.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.colorbox-min.js")" type="text/javascript"></script>

   <script language="javascript" type="text/javascript">
       jQuery(function () {
           // show a simple loading indicator
           var loader = jQuery('<div id="loader"><img src="@Url.Content("~/Content")/loading.gif" alt="loading..." /></div>')
			.css({ position: "relative", top: "1em", left: "25em" })
			.appendTo("body")
			.hide();
           jQuery().ajaxStart(function () {
               loader.show();
           }).ajaxStop(function () {
               loader.hide();
           }).ajaxError(function (a, b, e) {
               throw e;
           });

          @foreach (var project in Model)
          {
          <text>
           var v = jQuery("#ProjectEditForm-@project.ProjectId").validate({
               submitHandler: function (form) {
                   $.post($("#ProjectEditForm-@project.ProjectId").attr("action"), $("#ProjectEditForm-@project.ProjectId").serialize(),
                                    function (response) {
                                        $("#result").html(response);
                                    });
                    $.colorbox.close();
                    return false;
               }
           });

           </text>

           }

       });

          @foreach (var project in Model)
          {
          <text>
           $(function () {
               $(".editProject-@project.ProjectId").colorbox({ inline: true, href: "#ProjectEditForm-@project.ProjectId",
                   transition: "fade",
                   width: "80%", height: "70%", opacity: "0.7", overlayClose: false
               });
           });
           </text>
         } 
   </script>
}

@{
    ViewBag.Title = "Project Review - Design Constraints and Design Standards";
}

@if (Model == null || Model.Count == 0)
{
    <h2>No projects are assigned to you for review.</h2>;
    return;
}    




<strong><div id="result"></div></strong><br />
<table>
@foreach (var project in Model)
{
    <tr><td>
    Review Project: <a class='editProject-@project.ProjectId' href="#"> @project.ProjectId - @project.ProjectTitle</a>
    </td>
    <td>
     <span>Download the Project Proposal: </span> <a href="@Url.Content("~/Content")/Docs/@project.ProjectId-ProjectProposal.docx"> @project.ProjectId-ProjectProposal.docx</a>
    
    </td></tr>

}
</table>

<!-- This contains the hidden content for inline calls -->
@foreach (var project in Model)
{
    <div style='display:none'>
        <form action="@Url.Content("~/Home")/AddProjectReviewFeedback" id='ProjectEditForm-@project.ProjectId' method="post">
                <input type="hidden" name="ProjectId" id="ProjectId" value="@project.ProjectId" />
                <table>
                <tr><td>
                     <strong>Project Title:</strong>
                </td></tr>
                <tr><td align="justify">
                   @project.ProjectTitle
                </td></tr>
                <tr><td>
                        <em>*</em><strong>Design Constraints and Design Standards - Review Feedback (will be sent to Students and supervisor)</strong>
                </td></tr>
                <tr><td >
                    <textarea class="required" minlength="200" id="ReviewFeedback" name="ReviewFeedback" rows="20">@project.ReviewFeedback</textarea>
                </td></tr>
                <tr><td align="center">
                    <input type="submit" value="Save" id="btnSave" />
                </td></tr>
            </table>
        </form>
    </div>
}
